package com.stylefeng.guns.modular.merchant.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.stylefeng.guns.modular.merchant.dao.MerchantDao;
import com.stylefeng.guns.modular.merchant.service.MerchantService;
import com.stylefeng.guns.modular.merchant.transfer.MerchantDto;

@Service
@Transactional
public class MerchantServiceImpl implements MerchantService{

	@Resource
	private MerchantDao merchantDao;
	
	@Override
	public int insertMerchant(MerchantDto merchant) {
		merchant.setCreatedate( new Date());
		//首先插入商户信息
		merchantDao.insertMerchant(merchant);
		//插入商户登录用户信息
		merchantDao.insertMerchantUser(merchant);
		return merchant.getMerseq();
	}

}
